
// import Foo  from '../../view/foo.vue';
const userLogin = () => import('../view/login/login.vue');
const mainView = () => import('../view/mainView.vue');
const homePage = () => import('../view/homePage.vue');

/** 用户信息 */
const user_menuManage = () => import('../view/user/menuManage.vue');
const user_roleManage = () => import('../view/user/roleManage.vue');
const user_manage = () => import('../view/user/userManage.vue');
const user_dept = () => import('../view/user/deptManage.vue');
const error = () => import('../view/error/error.vue');

/** 基础信息 */
const basic_generator = () => import('../view/basic/generator.vue');
const basic_sysDict = () => import('../view/basic/sysDict.vue');
const basic_operate_log = () => import('../view/basic/operateLog.vue');
const basic_quartz_job = () => import('../view/basic/quartzJob.vue');
const elasticsearch = () => import('../view/basic/elasticsearch.vue');

/** 文档信息 */
const document = () => import('../view/doc/document.vue');
const doc_share = () => import('../view/doc/share.vue');

/** 消息信息 */
const basic_notepad = () => import('../view/basic/notepad.vue');

/** 文件目录 */
const basic_catalog = () => import('../view/basic/catalog.vue');

/** 物联网平台 */
const mqtt_user = () => import('../view/iot/mqttUser.vue');
const mqtt_acl = () => import('../view/iot/mqttAcl.vue');
const mqtt_log = () => import('../view/iot/mqttLog.vue');

const childrenRoutes = [
    { path: '/homePage', component: homePage, meta: { requiresAuth: true } },
    { path: '/user/menuManage', component: user_menuManage, meta: { requiresAuth: true } },
    { path: '/user/roleManage', component: user_roleManage, meta: { requiresAuth: true } },
    { path: '/user/deptManage', component: user_dept, meta: { requiresAuth: true } },
    { path: '/user', component: user_manage, meta: { requiresAuth: true } },

    { path: '/basic/generator', component: basic_generator, meta: { requiresAuth: true } },
    { path: '/basic/sysDict', component: basic_sysDict, meta: { requiresAuth: true } },
    { path: '/basic/notepad', component: basic_notepad, meta: { requiresAuth: true } },
    { path: '/basic/catalog', component: basic_catalog, meta: { requiresAuth: true } },
    { path: '/basic/operateLog', component: basic_operate_log, meta: { requiresAuth: true } },
    { path: '/basic/quartzJob', component: basic_quartz_job, meta: { requiresAuth: true } },
    { path: '/basic/elasticsearch', component: elasticsearch, meta: { requiresAuth: true } },

    { path: '/doc/document', component: document, meta: { requiresAuth: true } },

    { path: '/mqtt/user', component: mqtt_user, meta: { requiresAuth: true } },
    { path: '/mqtt/acl', component: mqtt_acl, meta: { requiresAuth: true } },
    { path: '/mqtt/log', component: mqtt_log, meta: { requiresAuth: true } },
    
    { path: '/error', component: error, meta: { requiresAuth: true } }
]

const routes = [
    { path: '/', component: userLogin, meta: { requiresAuth: false } },
    { 
        path: '/mainView', component: mainView, 
        children: childrenRoutes,
        meta: { requiresAuth: true }
    },
    { path: '/doc/share', component: doc_share, meta: { requiresAuth: false } },
    { path: '/error', component: error, meta: { requiresAuth: false } }
];

export {routes};